package com.kube.design.singleton;

/**
 * @author q.zhangr
 * @version 1.0.0
 * @date 2020/7/22
 */
public class User {

    //私有化构造函数
    User(){ }

    //对外暴露一个获取User对象的静态方法
    public static User getInstance(){
        return SingletonEnum.INSTANCE.getInstnce();
    }

    public static class Test {
        public static void main(String [] args){
            System.out.println(User.getInstance());
            System.out.println(User.getInstance());
            System.out.println(User.getInstance()==User.getInstance());
        }
    }
}
